//
//  CommonDataBase.m
//  AlumniBook
//
//  Created by 喂！ on 2018/10/30.
//  Copyright © 2018年 well. All rights reserved.
//

#import "CommonDataBase.h"

@implementation CommonDataBase

+(LKDBHelper *)getUsingLKDBHelper
{
    static LKDBHelper* db;
    static dispatch_once_t onceToken;
    
    NSFileManager *fileMgr=[NSFileManager defaultManager];
    NSString *path = [[WellConfig sharedInstance].homeDir stringByAppendingPathComponent:@"DataBase"];
    
    if(![fileMgr fileExistsAtPath:path])
    {
        [fileMgr createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
    }
    
    path = [path stringByAppendingPathComponent:@"info.db"];
    
    dispatch_once(&onceToken, ^{
        db = [[LKDBHelper alloc] initWithDBPath:path];
    });
    return db;
}

@end
